//app.js
var config = require('config/config.js')
App({
  onLaunch: function () {
    var that  = this;
    // 展示本地存储能力
    var logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs);
  },
  //窗体给高度
  globalData: {
    userInfo: null,
 
  },
 //检查是否登录
  checkLogin: function () {
    var flag = true;
    var member_info = wx.getStorageSync('member_info');
    if (member_info == '') {
      flag = false;
    }
    if (member_info == undefined) {
      flag = false;
    }
    if (!member_info) {
      flag = false;
    }
    if (typeof (member_info) == 'object') {
      flag = false;
      for (var key in member_info) {
        flag = true;
        break;
      }
    }
    return flag;
  },
   //二级页面检查登录
  checkedLogin: function () {
    var flag = true;
    var member_info = wx.getStorageSync('member_info');
    if (member_info == '') {
      flag = false;
    }
    if (member_info == undefined) {
      flag = false;
    }
    if (!member_info) {
      flag = false;
    }
    if (typeof (member_info) == 'object') {
      flag = false;
      for (var key in member_info) {
        flag = true;
        break;
      }
    }
    return flag;
  },
//   //三级页面检查登录
 recheckedLogin: function () {
   var flag = true;
   var member_info = wx.getStorageSync('member_info');
   if (member_info == '') {
     flag = false;
   }
   if (member_info == undefined) {
     flag = false;
   }
   if (!member_info) {
     flag = false;
   }
   if (typeof (member_info) == 'object') {
     flag = false;
     for (var key in member_info) {
       flag = true;
       break;
     }
   }
   return flag;
 }
})